/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package client;

import java.io.*;
import java.sql.*;
import java.util.ArrayList;
import oracle.jdbc.pool.OracleDataSource;
/**
 *
 * @author piotrek
 */
public class Module {
    protected Statement stmt;
    protected int columns;
    protected ArrayList<Object[]> set;

    private String user;
    private char[] pass;
    private String server;
    
    public Module(String username, char[] password, String server) throws SQLException {
        user=username;
        pass=password;
        this.server=server;
        OracleDataSource ods = new OracleDataSource();
        String tmp=new String(password);
        ods.setURL("jdbc:oracle:thin:"+tmp+"/"+username+":1521/"+server);
        Connection conn = ods.getConnection();
        stmt = conn.createStatement();
        set=new ArrayList<Object[]>();
    }

    public void loadTable() {}

    public ArrayList<Object[]> getElements() {
        return set;
    }

    public String getUsername(){return user;}

    public char[] getPassword(){return pass;}

    public String getServer(){return server;}
}
